package com.letv.whatslive.common.utils;

/**
 * Created by gaoshan on 15-8-1.
 */
public class Constants {


    public static final String ENCODING = "UTF-8";

    //直播聊天消息默认事件
    public static final String DEFAULT_CHAT_EVENT = "message";

    //非直播聊天消息默认事件
    public static final String CHAT_EVENT_COMMENT = "comment";

    //推送消息默认事件
    public static final String DEFAULT_PUSH_EVENT = "push";

    //推送通知默认事件
    public static final String DEFAULT_PUSH_MESSSAGE_EVENT = "pushMessage";

    public static final String CHAT_TOPIC_CHAT = "chat";

    public static final String CHAT_TOPIC_CHATROOM = "chatroom";

    //乐嗨全局聊天室在线用户，用zset结构存储
    public static final String LIVE_GLOBAL_ONLINE_USER_ZSET = "live_global_online_user_zset";
    //好友（关注和被关注），用set结构存储，需要拼上用户ID
    public static final String LIVE_FOLLOWANDFOCUSFRIENDS_SET = "live_followandfocusfriends_set_";
    //在线好友（关注和被关注），用set结构存储，需要拼上用户ID，这个是临时的
    public static final String LIVE_LIVE_FOLLOWANDFOCUSFRIENDS_SET = "live_online_followandfocusfriends_set_";

    //乐嗨推送服务在线用户key 后面需要拼上UID
    public static final String LIVE_PUSH_ONLINE_USER_KEY = "live_push_online_user_";

//    //乐嗨推送服务用户信息缓存 后面需要拼上UID
//    public static final String LIVE_PUSH_USER_CACHE_MESSAGE_KEY = "live_push_user_cache_message_";
//
//    //乐嗨推送服务用户信息缓存 后面需要拼上UID
//    public static final String LIVE_PUSH_USER_MESSAGE_NOT_SEND_COUNT_KEY = "live_push_user_message_not_send_count_";

    public static final String LIVE_PUSH_USER_CHANNELID_KEY = "live_push_user_channelid_";

    //直播间用户key 后面需要拼上roomId和uid
    public static final String LIVE_ROOM_KEY = "live_room_";

    //用户和设备key 后面需要拼上uid和udid
    public static final String LIVE_USER_KEY = "live_user_";


    //某直播的在线观看用户，sortedSet结构只存uid，需要拼上直播ID
    public static final String LIVE_ONLINE_USER_LIST_KEY = "live_online_user_sortedset_";

    //某直播用户进入房间的次数统计，正常应该是1或者0
    public static final String LIVE_ONLINE_USER_COME_COUT = "live_online_user_come_cout_";

    //某个直播的观看人次缓存，需要拼上直播ID
    public static final String LIVE_ONLINE_WATCH_KEY = "live_online_watchCount_";

    //某个直播的赞数缓存，需要拼上直播ID
    public static final String LIVE_ONLINE_LIKE_KEY = "live_online_likenum_";

    //某个直播的评论数缓存，需要拼上直播ID
    public static final String LIVE_ONLINE_COMMENT_KEY = "live_online_commentnum_";

    //观看过当前直播的所有用户列表，使用hash结构，需要拼上直播ID，hash里面的key为用户id
    public static final String LIVE_ONLINE_TOTALUSER_KEY = "live_online_totaluser_hash_";

    //某直播的真实在线观看用户，sortedSet结构只存uid，需要拼上直播ID
    public static final String LIVE_ONLINE_REAL_USER_LIST_KEY = "live_online_real_user_sortedset_";

    //某个直播的真实观看人次缓存，需要拼上直播ID
    public static final String LIVE_ONLINE_REAL_WATCH_KEY = "live_online_real_watchCount_";


    //某个直播的真实用户赞数缓存，需要拼上直播ID
    public static final String LIVE_ONLINE_REAL_LIKE_KEY = "live_online_real_likenum_";

    //某个直播的真实用户评论数缓存，需要拼上直播ID
    public static final String LIVE_ONLINE_REAL_COMMENT_KEY = "live_online_real_commentnum_";

    //观看过当前直播的所有真实用户列表，使用hash结构，需要拼上直播ID
    public static final String LIVE_ONLINE_REAL_TOTALUSER_KEY = "live_online_real_totaluser_hash_";

    //一个直播的最近评论
    public static final String LIVE_RECENT_COMMENT_KEY = "live_recent_comment_";

    //一个直播最近一条系统评论
    public static final String LIVE_RECENT_COMMENT_SYSTEM_KEY = "live_recent_system_comment_";

    //一个直播的点赞数消息队列
    public static final String LIVE_LIKE_LIST_KEY = "live_like_list_";

    //一个直播的评论，用户进入退出消息队列
    public static final String LIVE_COMMENT_LIKE_KEY = "live_comment_list_";

    //全局点赞图标资源key
    public static final String GLOBAL_LIKE_ICON_KEY = "global_like_icon";

    //用户消息阅读状态
    public static final int MESSAGE_READ_NO = 0;
    public static final int MESSAGE_READ_ALREADY = 1;
    public static final int MESSAGE_DELETE = 2;

    //用户默认头像
    public static final String USER_ICON_DEFAULT = "http://g3.letv.cn/vod/v1/MTUyLzI1LzM1L2xldHYtaXR2Mi8wL3N0YXRpY2ZpbGUvbWF0ZXJpYWxzLzIwMTUwODEzL2ZlNmJmNmMxMWIwOWRkMjI1MWViMTY5MzYzZDMwNWIxLnBuZw==?b=123456&platid=5&splatid=500";

    /**
     * 版本控制常量
     * menu：首页分类
     */
    public static final String VERSION_CONTROL_TYPE_MENU = "menu";

    // 转录播失效时间21600000毫秒(6*60*60*1000)
    public static final long LIVE_CONVERT_TO_REPLAY_EXPIRE_TIME = 21600000L;

    // 全局开关
    public static final String GLOBAL_SWITCH = "golobal_switch";

    // 全局开关类型(1: 第三方APP推荐开关)
    public static final int GLOBAL_SWITCH_TYPE_THIRD_APP_RECOMMEND = 1;

    // 全局开关类型(2: 送审中APP版本号 后面需要拼_API版本号)
    public static final int GLOBAL_SWITCH_TYPE_VERIFYING_APP_VERSION = 2;

    // 用户黑名单
    public static final String FORBIDDEN_USER = "forbidden_user";
    // 设备黑名单
    public static final String FORBIDDEN_DEVICE = "forbidden_device";

    // 禁止直播用户，需要拼接用户Id
    public static final String FORBIDDEN_LIVE_USER = "forbidden_live_user_";
    // 禁言用户，需要拼接用户Id
    public static final String FORBIDDEN_COMMENT_USER = "forbidden_comment_user_";

    // 当前正在直播的用户，用zset结构存储
    public static final String LIVE_GLOBAL_LIVE_IN_PROGRESS_USER_ZSET = "live_global_live_in_progress_user_zset";

    // 直播信息缓存Key，后面需要拼上programId
    public static final String LIVE_INFO = "live_info_";

    // 当前直播的机器人观众列表, 用set结构，后面需要拼上programId
    public static final String ROBOT_LIVE_USER = "robot_live_user_set_";

    // 短视频播放页下方TA的作品推荐，拼上userId和programId
    public static final String PROGRAM_H5_VIDEO_USER = "program_h5_video_user_";

    // web 直播&回放推荐列表，拼接programId、start、limit
    public static final String PROGRAM_WEB_RECOMMEND = "program_web_recommend_";

    // H5 直播&回放推荐列表，拼接programId、start、limit
    public static final String PROGRAM_H5_RECOMMEND = "program_h5_recommend_";

    // H5 活动，拼接活动id
    public static final String ACTIVITY_H5_INFO = "activity_h5_info_";

    // H5 活动直播、回放视频列表，拼接活动id、start、limit
    public static final String ACTIVITY_H5_PROGRAM_LIST = "activity_h5_program_list_";


    //视频删除标志
    public static final Integer OPERATOR_OFFLINE_PROGRAM = 1;//运营下线
    public static final Integer USER_DELETE_PROGRAM = 2;//用户删除
    public static final Integer OPERATOR_OFFLINE_ONLINE_PROGRAM = 3;//运营下线后又上线
    public static final Integer STREAMING_NOT_START = 4; // 推流未开始
    public static final Integer TENCENT_NOT_SUPPORT_LIVE_CONVERT_TO_REPLAY = 5; // 腾讯云不支持直播转点播
    public static final Integer SCAN_OFFLINE = 6; // 后台监控自动下线
    public static final Integer REPLAY_CONVERT_FAILURE = 7; // 转录播失败下线，超过六个小时没有转码回调

    // 不加入机器人的用户列表，用set存储
    public static final String NOROBOT_USER = "norobot_user_set";

    // 转录播状态码
    public static final String REPLAY_CONVERT_STATUS_OK = "OK"; // 成功
    public static final String REPLAY_CONVERT_STATUS_UPLOAD_OVER = "UPLOAD_OVER"; // 上传完毕
    public static final String REPLAY_CONVERT_STATUS_PLAY_OK = "PLAY_OK"; // 可以正常播放
    public static final String REPLAY_CONVERT_STATUS_DEAL_FAILED = "DEAL_FAILED"; // 转码失败
    public static final String REPLAY_CONVERT_STATUS_SOURCE_FAILED = "SOURCE_FAILED"; // 片源错误
    public static final String REPLAY_CONVERT_STATUS_PUBLISH_FAILED = "PUBLISH_FAILED"; // 发布失败
    public static final String REPLAY_CONVERT_STATUS_UPLOAD_FAILED = "UPLOAD_FAILED"; // 上传失败
    public static final String REPLAY_CONVERT_STATUS_CHECK_FAILED = "CHECK_FAILED"; // 审核失败

    // 直播服务提供商(1: 乐视)
    public static final int LIVE_SERVICE_PROVIDER_LE = 1;

    // 直播服务提供商(2: 腾讯)
    public static final int LIVE_SERVICE_PROVIDER_TENCENT = 2;

    // 视频来源
    public static final int SOURCE_TYPE_LE_LIVE = 1; // 1:乐视云个人直播
    public static final int SOURCE_TYPE_THIRDPARTY_LIVE = 2; // 2:第三方直播(rtmp)
    public static final int SOURCE_TYPE_TENCENT_LIVE = 3; // 3:TX云直播
    public static final int SOURCE_TYPE_LE_CAROUSEL_CHANNEL = 4; // 4:乐视网hls轮播台
    public static final int SOURCE_TYPE_LE_REPLAY = 5; // 5:云点播
    public static final int SOURCE_TYPE_LE_UPLOAD_VIDEO = 6; // 6:上传视频
    public static final int SOURCE_TYPE_TENCENT_REPLAY = 7; // 7:TX点播
    public static final String HD_ALLOWS_MAP = "hd_allows_map"; // 高清白名单

    // 视频上传状态
    public static final int VIDEO_UPLOAD_STATUS_UPLOAD_SUCCESS = 0; // 视频上传成功
    public static final int VIDEO_UPLOAD_STATUS_MEDIA_UPLOAD_SUCCESS = 1; // 视频上传媒资成功
    public static final int VIDEO_UPLOAD_STATUS_TRANSCODE_SUCCESS = 2; // 视频转码成功
    public static final int VIDEO_UPLOAD_STATUS_UPLOAD_FAILURE = -1; // 视频上传失败
    public static final int VIDEO_UPLOAD_STATUS_MEDIA_UPLOAD_FAILURE = -2; // 视频上传媒资失败
    public static final int VIDEO_UPLOAD_STATUS_TRANSCODE_FAILURE = -3; // 视频转码失败

    // 视频上传审核状态
    public static final int VIDEO_UPLOAD_FIRST_REVIEW_STATUS_IN_REVIEW = -1; // 审核中
    public static final int VIDEO_UPLOAD_FIRST_REVIEW_STATUS_NG = 0; // 一审不通过
    public static final int VIDEO_UPLOAD_FIRST_REVIEW_STATUS_OK = 1; // 一审通过
    public static final int VIDEO_UPLOAD_SECOND_REVIEW_STATUS_NG = 2; // 二审不通过
    public static final int VIDEO_UPLOAD_SECOND_REVIEW_STATUS_OK = 3; // 二审通过

    // 视频上传类型（短视频、长视频）
    public static final Integer VIDEO_UPLOAD_TYPE_SHORT = 0;   // 短视频
    public static final Integer VIDEO_UPLOAD_TYPE_LONG = 1;   // 长视频

    // 视频上传用户角色
    public static final Integer VIDEO_UPLOAD_ROLE_USER = 1;   // 用户上传
    public static final Integer VIDEO_UPLOAD_ROLE_OPERATE = 2;   // 运营上传

    // 视频上传当前任务类型
    public static final String CURRENT_TASK_UPLOAD_TO_MEDIA = "lepai2MmsC";   // 媒资上传
    public static final String CURRENT_TASK_TRANSCODE = "transcode";   // 转码
    public static final String CURRENT_TASK_AUDIT = "audit"; // 审核

    /**
     * 视频旋转参数
     */
    public static final String ROTATE_90 = "--rotate=4";
    public static final String ROTATE_180 = "--rotate=3";
    public static final String ROTATE_270 = "--rotate=5";

    /**
     * 上传视频转码类型
     */
    public static final String VIDEO_UPLOAD_TRANSCODE_TYPES = "9,13,21,28";
    /**
     * 乐嗨appId
     */
    public static final String APP_ID_WHATSLIVE = "10000";

    /**
     * 乐嗨appName
     */
    public static final String APP_NAME_WHATSLIVE = "乐嗨";

    /**
     * 直播操作(消息通知用)
     */
    public static final String PROGRAM_OPERATION_CREATE = "create"; // 创建直播
    public static final String PROGRAM_OPERATION_CLOSE = "close"; // 结束直播 (消息中追加：isShow)
    public static final String PROGRAM_OPERATION_REPLAY_CONVERT = "replay convert"; // 转录播
    public static final String PROGRAM_OPERATION_ONLINE = "online"; // 上线直播
    public static final String PROGRAM_OPERATION_OFFLINE = "offline"; // 下线直播
    public static final String PROGRAM_OPERATION_START_PLAN = "start plan"; // 开始预约直播
    public static final String PROGRAM_OPERATION_REMOVE_BY_USER = "remove by user"; // 用户删除个人直播
    public static final String PROGRAM_OPERATION_RECOMMEND = "recommend"; // 推荐
    public static final String PROGRAM_OPERATION_RECOMMEND_CANCEL = "recommend cancel"; // 取消推荐
    public static final String PROGRAM_OPERATION_CREATE_EMPTY_FOR_SHARE = "create empty for share"; // 创建分享用空直播
    public static final String PROGRAM_OPERATION_CREATE_EMPTY_PLAN_FOR_SHARE = "create empty plan for share"; // 创建分享用空预约直播
    public static final String PROGRAM_OPERATION_CREATE_PLAN = "create plan"; // 创建预约直播
    public static final String PROGRAM_OPERATION_CLOSE_PLAN = "close plan"; // 取消预约直播
    public static final String PROGRAM_OPERATION_UPDATE_PICTURE = "update picture"; // 更新封面图
    public static final String PROGRAM_OPERATION_ADD_TO_ASSORTS = "add to assorts"; // 将视频加入分类
    public static final String PROGRAM_OPERATION_DEL_FROM_ASSORTS = "del from assorts"; // 将视频从分类中移除
    public static final String PROGRAM_OPERATION_CHANGE_ASSORTS_PRIORITY = "change assorts priority"; // 修改分类优先级
    public static final String PROGRAM_OPERATION_ADD_TO_ACTIVITY = "add to activity"; // 将视频加入活动
    public static final String PROGRAM_OPERATION_DEL_FROM_ACTIVITY = "del from activity"; // 将视频从活动中移除
    public static final String PROGRAM_OPERATION_CHANGE_ACTIVITY_PRIORITY = "change activity priority"; // 修改活动优先级
    public static final String PROGRAM_OPERATION_UPDATE_ORDER_NUMBER = "update order number"; // 更新预约人数
    public static final String PROGRAM_OPERATION_UPDATE_MACHINE_COUNT = "update machine count"; // 更新机位数
    public static final String PROGRAM_OPERATION_UPDATE_STREAM_INFO = "update stream info"; // 更新视频流信息
    public static final String PROGRAM_OPERATION_UPDATE_UPLOAD_VIDEO_INFO = "update upload video info"; // 更新上传视频信息
    public static final String PROGRAM_OPERATION_UPDATE_BY_CMS = "update by cms"; // CMS更新直播信息
    public static final String PROGRAM_OPERATION_CHANGE_LOCATION_TO_SHOW = "change location to show"; // 修改显示区域
    public static final String PROGRAM_OPERATION_UPDATE_PRIORITY = "update priority"; // CMS更新直播权重
    public static final String PROGRAM_OPERATION_UPDATE_USER_ROLE = "update user role"; // CMS更新视频的用户角色
    public static final String PROGRAM_OPERATION_ADD_REPLAY = "add replay"; // CMS新增录播


    /**
     * 好友操作(消息通知用)
     */
    public static final String FRIEND_OPERATION_UNFOLLOW = "0"; // 取消关注
    public static final String FRIEND_OPERATION_FOCUS = "1"; // 关注

    /**
     * mongo读库设定
     */
    public static final String MONGO_READPREFERENCE_PRIMARY = "1"; // 读主库

    /**
     * 系统消息更新时间
     */
    public static final String SYSTEM_MESSAGE_UPDATE_TIME = "system_message_update_time";

    /**
     * 关注列表最大长度
     */
    public final static long FOCUS_PROGRAM_LIST_MAX_SIZE = 250L;

    /**
     * 嗨秀列表最大长度
     */
    public final static long HI_SHOW_PROGRAM_LIST_MAX_SIZE = 20000L;

    /**
     * 全民列表最大长度
     */
    public final static long NATIONAL_PROGRAM_LIST_MAX_SIZE = 20000L;

    //广场页轮播图个数
    public final static int SQUARE_CAROUSELIMAGE_COUNT = 5;

    //广场页上广场个数
    public final static int SQUARE_PROGRAM_COUNT = 12;

    //碎片，广场页-上广场
    public final static String CHIPS_SQUARE_PROGRAM = "广场页-上广场";

    //碎片，广场页-轮播图
    public final static String CHIPS_SQUARE_CAROUSELIMAGE = "广场页-轮播图";

    //24小时轮播台分类ID
    public final static Long ASSORTS_ID_CAROUSEL = 13L;
    /**
     * 分类中推荐上传视频ID
     */
    public static final Long MENU_UPLOAD_VIDEO_RECOMMEND = -1L;

    /**
     * 图片分类
     */
    public final static int PIC_CATEGORY_PROGRAM = 1; // 1: 视频图片
    public final static int PIC_CATEGORY_USER = 2; // 2: 用户图片

    /**
     * 图片类型
     */
    public final static int PIC_TYPE_PROGRAM_COVER = 1; // 1: 视频封面图
    public final static int PIC_TYPE_PROGRAM_COVER_BIG = 2; // 2: 视频大图封面
    public final static int PIC_TYPE_PROGRAM_COVER_LIST = 3; // 3: 视频列表封面
    public final static int PIC_TYPE_USER_ICON = 4; // 4: 用户头像
    public final static int PIC_TYPE_USER_PRESET_PROGRAM_COVER = 5; // 5: 用户预置视频封面
    public final static int PIC_TYPE_IDCARD_FRONT = 6; // 6：身份证正面
    public final static int PIC_TYPE_IDCARD_BACK = 7; // 7：身份证反面


    /**
     * 消息发送应用
     */
    public final static String MSG_SENDER_API = "api";
    public final static String MSG_SENDER_CMS = "cms";
    public final static String MSG_SENDER_INNERSERVICE = "innerService";

    /**
     * 运行模式
     */
    public final static int RUN_MODE_BACKGROUND = 0; // 0：后台运行
    public final static int RUN_MODE_FOREGROUND = 1; // 1: 前台运行

    /**
     * 用户角色
     */
    public static final int USER_ROLE_NORMAL = 0; // 0: 普通用户
    public static final int USER_ROLE_NORMAL_AUTHENTICATE = 1; // 1: 普通认证用户
    public static final int USER_ROLE_ENTERPRISE_AUTHENTICATE = 3; // 3: 企业认证用户
    public static final int USER_ROLE_HOST = 4; // 4: 主播

    /**
     * 媒资信息
     */
    public static final String LEHI_MMS_CID = "1029"; // 频道ID
    public static final String LEHI_MMS_SOURCEID = "200023"; // 视频来源

    /**
     * 微店信息
     */
    public static final String WEIDIAN_SHOP_URL = "https://weidian.com/?userid="; //微店URL前缀
    public static final String WEIDIAN_ITEM_URL = "https://weidian.com/item.html?itemID="; //微店商品URL前缀


    //实名认证短信验证码，需要拼接用户ID+CountryCodeID+手机号
    public static final String REALNAME_AUTHENTICATION_MESSAGECODE = "realname_authentication_";
    //实名认证解绑短信验证码，需要拼接用户ID+CountryCodeID+手机号
    public static final String REALNAME_DEAUTHENTICATION_MESSAGECODE = "realname_deauthentication_";
    //实名认证短信每日限量，需要拼接CountryCodeID+手机号
    public static final String REALNAME_AUTHENTICATION_MESSAGECODE_LIMIT = "realname_authentication_limit_";
    //实名认证短信验证码有效时间，单位分钟
    public static final int REALNAME_AUTHENTICATION_MESSAGECODE_CACHETIME=5;
    //实名认证短信每日限量条数
    public static final int REALNAME_AUTHENTICATION_MESSAGECODE_LIMIT_COUNT=20;
    //实名认证短信限发次数时间间隔，单位分钟
    public static final int REALNAME_AUTHENTICATION_MESSAGECODE_PER_LIMIT_TIME=5;
    //实名认证短信间隔时间段内限发次数
    public static final int REALNAME_AUTHENTICATION_MESSAGECODE_PER_LIMIT_TIME_COUNT=3;
    //达到限发次数后禁止重发时间间隔，单位分钟
    public static final int REALNAME_AUTHENTICATION_MESSAGECODE_PER_LIMIT_TIME_COUNT_LIMIT=2;
    //实名认证时间间隔内的获取绑定短信次数统计，需要拼接CountryCodeID+手机号
    public static final String REALNAME_AUTHENTICATION_MESSAGECODE_PER_LIMIT = "realname_authentication_per_limit_";
    //实名认证时间间隔内的获取解绑短信次数统计，需要拼接CountryCodeID+手机号
    public static final String REALNAME_DEAUTHENTICATION_MESSAGECODE_PER_LIMIT = "realname_deauthentication_per_limit_";
    //实名认证禁止重发标记
    public static final String REALNAME_AUTHENTICATION_MESSAGECODE_PER_LIMIT_LIMITEDFLAG = "realname_authentication_per_limit_limitedflag";
    //实名认证解绑短信禁止重发标记
    public static final String REALNAME_DEAUTHENTICATION_MESSAGECODE_PER_LIMIT_LIMITEDFLAG = "realname_deauthentication_per_limit_limitedflag";
    //实名认证时间间隔内的提交认证验证码错误次数统计，需要拼接CountryCodeID+手机号
    public static final String REALNAME_AUTHENTICATION_MESSAGECODE_SUBMIT_PER_LIMIT = "realname_authentication_submit_per_limit_";
    //实名认证时间间隔内的解绑证验证码错误次数统计，需要拼接CountryCodeID+手机号
    public static final String REALNAME_DEAUTHENTICATION_MESSAGECODE_SUBMIT_PER_LIMIT = "realname_deauthentication_submit_per_limit_";
    //实名认证禁止重发标记
    public static final String REALNAME_AUTHENTICATION_MESSAGECODE_SUBMIT_PER_LIMIT_LIMITEDFLAG = "realname_authentication_submit_per_limit_limitedflag";
    //实名认证解绑短信禁止重发标记
    public static final String REALNAME_DEAUTHENTICATION_MESSAGECODE_SUBMIT_PER_LIMIT_LIMITEDFLAG = "realname_deauthentication_submit_per_limit_limitedflag";



    public static final int PROGRAM_BUSINESS_ID = 10000; // 中国

}
